package com.wbao.dianniu.manager;

import java.util.ArrayList;
import java.util.List;

import android.graphics.Bitmap;

import com.wbao.dianniu.listener.IHeadImageListener;

public class HeadImageManger {

	private static HeadImageManger instance;
	private static List<IHeadImageListener> mList;

	public static HeadImageManger getInstance() {
		if (null == instance) {
			instance = new HeadImageManger();
			mList = new ArrayList<IHeadImageListener>();
		}
		return instance;
	}

	
	public void addListener(IHeadImageListener listener) {
		mList.add(listener);
	}

	public void removeListener(IHeadImageListener listener) {
		mList.remove(listener);
	}

	public void removeAllListener() {
		mList = null;
	}
	public void changeImageData(String headCachePath) {
		for (int i = 0; i < mList.size(); i++) {
			mList.get(i).imageChange(headCachePath);
		}
	}
	
	public void changeDatas(String nickName,String sex,String signate,String label){
		for (int i = 0; i < mList.size(); i++) {
			mList.get(i).dataChanged(nickName, sex, signate, label);
		}
	}
	
}
